import marimo

__generated_with = "0.13.7"
app = marimo.App(width="medium")


@app.cell
def _():
    import marimo as mo
    return (mo,)


@app.cell
def _(mo):
    mo.md(r"""# 微积分""")
    return


@app.cell
def _():
    import numpy as np
    def f(x):
        return 3 * x ** 2 - 4 * x
    return (f,)


@app.cell
def _(f):
    def numerical_lim(f, x, h):
        return (f(x + h) - f(x)) / h

    h = 0.1
    for i in range(5):
        print(f'h={h:.5f}, numerical limit={numerical_lim(f, 1, h):.5f}')
        h *= 0.1

    return


@app.cell
def _(mo):
    mo.md(r"""### 偏导数""")
    return


@app.cell
def _(mo):
    mo.md(r"""## 梯度""")
    return


if __name__ == "__main__":
    app.run()
